export function to(url: string) {
  wx.navigateTo({ url });
}
export function toast(title: string, icon: any = "none") {
  wx.showToast({
    title,
    icon,
    mask: true,
  });
}
const logger = wx.getRealtimeLogManager();

export function err(err: any) {
  console.log(err);
  logger.error(err);
}
export function get(key: string) {
  return wx.getStorageSync(key);
}
export function set(key: string, value: any) {
  return wx.setStorageSync(key, value);
}
export function Try(data: any) {
  try {
    data();
  } catch (error) {
    err(error);
  }
}

export const { envVersion } = wx.getAccountInfoSync().miniProgram;
